package com.ugoodtech.mdcc.core.model.mapper.ext;

import com.ugoodtech.mdcc.core.model.entity.UnionIdOpenId;
import com.ugoodtech.mdcc.core.model.mapper.UnionIdOpenIdMapper;
import java.util.List;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * Created by Xiangcheng Li
 *
 * @author Xiangcheng Li
 */
public interface UnionIdOpenIdExtMapper extends UnionIdOpenIdMapper {

    @Insert({
        "<script>",
        "insert into union_id_open_id (union_id, ",
        "open_id, create_time, ",
        "update_time, deleted)",
        "values",
        "<foreach item = 'item' collection = 'record' separator = ','>",
        " ( #{item.unionId,jdbcType=VARCHAR}, ",
        "#{item.openId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, ",
        "#{item.updateTime,jdbcType=TIMESTAMP}, #{item.deleted,jdbcType=BIT})",
        "</foreach>",
        "</script>"

    })
    int batchInsert(@Param("record") List<UnionIdOpenId> record);

}
